package com.service.impl;

import com.bean.Answers;
import com.bean.KillList;
import com.bean.KillNode;
import com.bean.Questions;
import com.mapper.AnswersMapper;
import com.mapper.KillListMapper;
import com.mapper.KillNodeMapper;
import com.mapper.QuestionsMapper;
import com.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnswerServiceImpl implements AnswerService {

    @Autowired
    private AnswersMapper answersMapper;
    @Autowired
    private QuestionsMapper questionsMapper;


    @Autowired
    private KillListMapper killListMapper;
    @Autowired
    private KillNodeMapper killNodeMapper;

    @Override
    public List<Answers> checkAllAnswers() {
        answersMapper.selectAll();
        return  answersMapper.selectAll();
    }

    @Override
    public List<Questions> checkAllQuestions() {
        return questionsMapper.selectAll();
    }

    @Override
    public List<Answers> checkAnswersByCondition() {
        return null;
    }

    @Override
    public List<Questions> checkQuestionsByCondition() {
        return null;
    }

    @Override
    public int toKillNode(KillNode u) {
        return killNodeMapper.insertNode(u);
    }

    @Override
    public int toKillList(KillList u) {
        return killListMapper.insertKillList(u);
    }

    @Override
    public List<KillNode> selectNode(KillNode k) {
        return killNodeMapper.selectNode(k);
    }

    @Override
    public List<KillList> selectAllList() {
        return killListMapper.selectAllList();
    }

}
